﻿package mortal.game.view.npc.data
{
    import Message.Client.*;
    import Message.DB.Tables.*;
    import mortal.game.cache.*;
    import mortal.game.resource.*;

    public class NpcFunctionData extends Object
    {
        public var npcId:int;
        public var type:int;
        public var value:int;
        public var desc:String;
        public var minLv:int;
        public var maxLv:int;

        public function NpcFunctionData()
        {
            return;
        }// end function

        public function parse(param1:String) : void
        {
            var _loc_4:TCopy = null;
            var _loc_5:int = 0;
            var _loc_6:int = 0;
            var _loc_7:int = 0;
            var _loc_8:String = null;
            var _loc_2:* = param1.split("#");
            this.type = int(_loc_2[0]);
            this.value = int(_loc_2[1]);
            this.desc = String(_loc_2[2]);
            var _loc_3:* = String(_loc_2[3]).split("-");
            this.minLv = int(_loc_3[0]);
            this.maxLv = int(_loc_3[1]);
            if (this.type == ENPCFunType._ENPCFunCopy)
            {
                _loc_4 = CopyConfig.instance.getCopyInfoByCode(this.value);
                if (_loc_4 == null)
                {
                    return;
                }
                _loc_5 = Cache.instance.copy.getTodayEnterTimes(this.value);
                _loc_6 = _loc_4.dayNum;
                _loc_7 = _loc_4.enterMinLevel;
                if (_loc_5 >= _loc_6)
                {
                    _loc_8 = "<font color=\'#ff0000\'>(" + _loc_5 + "/" + _loc_6 + ")</font>";
                }
                else
                {
                    _loc_8 = "(" + _loc_5 + "/" + _loc_6 + ")";
                }
                this.desc = this.desc + _loc_8;
            }
            return;
        }// end function

    }
}
